is built
ErrorsCollection

is built

Synthesised documentation from type/Attribute

From type/Attribute

See Original text in context

multi sub trait_mod:<is>(Attribute:D $a:$built!)

By default, this trait allows setting up a private attribute during object construction via .new. The same trait can be used to prevent setting up a public attribute via .new by passing it the Boolean value False.

class Foo {
    has $!bar is built# same as `is built(True)` 
    has $.baz is built(False);
 
    method bar {
        $!bar
    }
}
 
my $foo = Foo.new(bar => 1baz => 2);
say $foo.bar# «1␤» 
say $foo.baz# «Any␤»